import Toast from 'tdesign-miniprogram/toast/index';

Page({
  data: {
    list: [
      {
        title: '2025年1月阿萨德阿萨德',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年2月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年3月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年4月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年5月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年6月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年7月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年8月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年9月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年10月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年11月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
      {
        title: '2025年12月',
        coverUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03',
        downloadUrl: 'http://120.41.36.48:62800/bugatti/attach/file/preview?id=811c6d12b9b33e4373c807d738f70d03'
      },
    ],//电子书列表
  },
  changCategory(e) {
    wx.downloadFile({
      url: e.currentTarget.dataset.item.downloadUrl,//文件下载地址
      success: function (res) {
        wx.showToast({
          title: '下载成功!',
        });
      },
      fail(res) {
        wx.showToast({
          icon: 'none',
          title: '下载失败!',
        });
      }
    })
  },
  onLoad(query) {
  },
})